<!DOCTYPE html>
<html lang="en">
<!--header-->
<include file="Public:header"/>
<style>
    .san{
        font-weight: bold;
        font-size: 16px;
        margin-left: 50px;
        margin: 20px 0;
        color: #1a1a1a;
    }
</style>
<!--header-->
<section id="main-content">
    <section class="wrapper">
        <h3><i class="fa fa-angle-right"></i> 添加/修改用户信息</h3>

        <!-- BASIC FORM ELELEMNTS -->
        <div class="row mt">
            <div class="col-lg-12">
                <div class="form-panel">
                    <h4 class="mb">
                        <i class="fa fa-angle-right"></i> 轮播图信息
                        <a class="btn btn-theme btn-default" onclick="history.go(-1)">返回</a>
                    </h4>
                    <div class="form-horizontal style-form" >
                        <div class="form-group" >
                            <label class="col-sm-2 col-sm-2 control-label">微信头像/昵称</label>
                            <div class="col-sm-10">
                                <img  src="{$list.headimgurl}" alt="" width="60" height="60" style="cursor:pointer">({$list.nickname})
                            </div>
                        </div>
                    </div>
                    <form id="one_img" class="form-horizontal style-form" method="post" action=""  enctype="multipart/form-data">
                        <div class="form-group" id="banner">
                            <label class="col-sm-2 col-sm-2 control-label">相册(<span style="color: red;">(310px*310px)</span>,最多四张)</label>
                            <div class="col-sm-10">
                                <input type="file" name="two[]" multiple="true"/>
                                <if condition = "$list['img'][0]">
                                    <img class="img-responsive" src="{$list.img.0}" style="width: 60px;height: 60px;border-radius: 50%">
                                </if>
                                <if condition = "$list['img'][1]">
                                    <img class="img-responsive" src="{$list.img.1}" style="width: 60px;height: 60px;border-radius: 50%">
                                </if>
                                <if condition = "$list['img'][2]">
                                    <img class="img-responsive" src="{$list.img.2}" style="width: 60px;height: 60px;border-radius: 50%">
                                </if>
                                <if condition = "$list['img'][3]">
                                    <img class="img-responsive" src="{$list.img.3}" style="width: 60px;height: 60px;border-radius: 50%">
                                </if>
                            </div>
                        </div>
                        <input type="hidden"  name="id" value="{$list.id}">
                    </form>
                        <div class="san">基本资料</div>
                        <div>
                            <form id="two_img" class="form-horizontal style-form" method="post" action=""  enctype="multipart/form-data">
                                <div class="form-group">
                                    <label class="col-sm-2 col-sm-2 control-label">用户头像<span style="color: red;">(160px*160px)</span></label>
                                    <div class="col-sm-10">
                                        <input type="file" name="one" id="avatar" onchange='PreviewImage(this)' style="opacity: 0;display: block;cursor:pointer" />
                                        <if condition="$list.avatar != NULL">
                                            <img class="ph-user"  src="{$list.avatar}" width="80" height="60" onclick="openFile()" style="cursor:pointer">
                                            <else/>
                                            <img class="ph-user" src="__PUBLIC__/img/wutu.png" alt="" width="80" height="80" onclick="openFile()" style="cursor:pointer">
                                        </if>
                                    </div>
                                </div>
                                <input type="hidden"  name="id" value="{$list.id}">
                            </form>
                        </div>
                    <form id="myForm" class="form-horizontal style-form" method="post" action="{:U('info_add')}"  enctype="multipart/form-data">
                        <div>
                            <if condition="QUAN eq 2">
                                <div class="form-group" >
                                    <label class="col-sm-2 col-sm-2 control-label"><span style="color: red;">修改vip信息</span></label>
                                    <div class="col-sm-10">
                                        <input id="type" name="type" value="2"  <if condition="$list.type eq 2">checked</if>  type="checkbox"  class="form-control"   style="width: 8%">
                                        <span id="gou" style="color: red;">*无特殊情况请勿勾选/修改此项</span>
                                    </div>
                                    <div id="vip_type" class="col-sm-10"  style="display: none;margin-left: -24%;width: 24%">
                                        <select  name="vip_type" class="form-control">
                                            <option value="0">vip级别（无特殊情况请勿修改此项）</option>
                                            <foreach name="vip" item="v">
                                                <option value="{$v.id}">{$v.tags}</option>
                                            </foreach>
                                        </select>
                                        <hr style="margin-top: 28px;margin-bottom: 4px;">
                                        <span style="color: red;">{$v_name}</span>
                                        <hr style="margin-top: 7px;">
                                        <br style="margin-top: 7px;">
                                        <div class="form-group">
                                            <label class="col-sm-2 col-sm-2 control-label" style="width: 100px;">鲜花数</label>
                                            <div class="col-sm-10">
                                                <input name="flowers" value="{$list.flowers}" type="text"  class="form-control">
                                            </div>
                                        </div>
                                        <div class="form-group" >
                                            <label class="col-sm-2 col-sm-2 control-label"  style="width: 100px;">积分数</label>
                                            <div class="col-sm-10">
                                                <input name="covers" value="{$list.covers}" type="text"  class="form-control">
                                            </div>
                                        </div>
                                        <div class="form-group" >
                                            <label class="col-sm-2 col-sm-2 control-label"  style="width: 100px;">查看人数</label>
                                            <div class="col-sm-10">
                                                <input name="cha_nums" value="{$list.cha_nums}" type="text"  class="form-control">
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </if>
                            <div class="form-group" >
                                <label class="col-sm-2 col-sm-2 control-label">线下活动次数</label>
                                <div class="col-sm-10">
                                    <input name="xian_nums" value="{$list.xian_nums}" type="text"  class="form-control">
                                </div>
                                <span>用户参加活动后可将该值减一</span>
                            </div>
                            <div class="form-group" >
                                <label class="col-sm-2 col-sm-2 control-label">户籍地</label>
                                <div class="col-sm-10">
                                    <input name="place" value="{$list.place}" type="text"  class="form-control"
                                           placeholder="请输入户籍地（例：陕西省汉中市西乡县）">
                                </div>
                            </div>
                            <div class="form-group" >
                                <label class="col-sm-2 col-sm-2 control-label">现居地址（三级联动）</label>
                                <div class="col-sm-10">
                                    <input name="address" value="{$list.address}" type="text"  class="form-control"
                                           placeholder="请输入户籍地（例：陕西省汉中市西乡县）">
                                </div>
                            </div>
                           <!-- <div class="form-group" >
                                <label class="col-sm-2 col-sm-2 control-label">工作地区***</label>
                                <div class="col-sm-10">
                                    <input name="address" value="{$list.address}" type="text"  class="form-control"
                                           placeholder="请输入地址">
                                </div>
                            </div>-->
                            <div class="form-group" >
                                <label class="col-sm-2 col-sm-2 control-label">出生年月日</label>
                                <div class="col-sm-10">
                                    <input name="age" value="{$list.age}" type="text"  class="form-control"
                                           placeholder="请输入出生年月日（例：1991-06-24）">
                                </div>
                            </div>
                            <div class="form-group" >
                                <label class="col-sm-2 col-sm-2 control-label">真实姓名</label>
                                <div class="col-sm-10">
                                    <input name="name" value="{$list.name}" type="text"  class="form-control"
                                           placeholder="请输入真实姓名">
                                </div>
                            </div>
                            <div class="form-group" >
                                <label class="col-sm-2 col-sm-2 control-label">身份证号（选填）</label>
                                <div class="col-sm-10">
                                    <input name="id_card" value="{$list.id_card}" type="text"  class="form-control"
                                           placeholder="请输入身份证号">
                                </div>
                            </div>
                            <div class="form-group" >
                                <label class="col-sm-2 col-sm-2 control-label">昵称</label>
                                <div class="col-sm-10">
                                    <input name="nick_name" value="{$list.nick_name}" type="text"  class="form-control"
                                           placeholder="请输入昵称">
                                </div>
                            </div>
                            <div class="form-group" >
                                <label class="col-sm-2 col-sm-2 control-label">性别</label>
                                <div class="col-sm-10">
                                    <select  name="sex" class="form-control">
                                        <option value="1" <if condition="$list['sex'] == 1">selected </if> >男</option>
                                        <option value="2" <if condition="$list['sex'] == 2">selected </if> >女</option>
                                        <option value="0" <if condition="$list['sex'] == 3">selected </if> >未知</option>
                                    </select>
                                </div>
                            </div>
                            <div class="form-group" >
                                <label class="col-sm-2 col-sm-2 control-label">电话</label>
                                <div class="col-sm-10">
                                    <input name="phone" value="{$list.phone}" type="text"  class="form-control"
                                           placeholder="请输入电话">
                                </div>
                            </div>
                            <div class="form-group" >
                                <label class="col-sm-2 col-sm-2 control-label">身高(单位：cm)</label>
                                <div class="col-sm-10">
                                    <select  name="heights" class="form-control">
                                        <foreach name="biao.heights" item="v">
                                            <option value="{$v.id}" <if condition="$list['heights'] == $v['id']">selected </if> >{$v.name}</option>
                                        </foreach>
                                    </select>
                                </div>
                            </div>
                            <div class="form-group" >
                                <label class="col-sm-2 col-sm-2 control-label">体重(单位：kg)</label>
                                <div class="col-sm-10">
                                    <select  name="weights" class="form-control">
                                        <volist name="biao.weights" id="v">
                                            <option value="{$v.id}" <if condition="$list['weights'] == $v['id']">selected </if> >{$v.name}</option>
                                        </volist>
                                    </select>
                                </div>
                            </div>
                            <div class="form-group" >
                                <label class="col-sm-2 col-sm-2 control-label">学历</label>
                                <div class="col-sm-10">
                                    <select  name="education" class="form-control">
                                        <volist name="biao.education" id="v">
                                            <option value="{$v.id}" <if condition="$list['education'] == $v['id']">selected </if> >{$v.name}</option>
                                        </volist>
                                    </select>
                                </div>
                            </div>
                            <div class="form-group" >
                                <label class="col-sm-2 col-sm-2 control-label">职业</label>
                                <div class="col-sm-10">
                                    <input name="jobs" value="{$list.jobs}" type="text"  class="form-control"
                                           placeholder="请输入职业">
                                </div>
                            </div>
                            <div class="form-group" >
                                <label class="col-sm-2 col-sm-2 control-label">月收入</label>
                                <div class="col-sm-10">
                                    <select  name="moneys" class="form-control">
                                        <volist name="biao.moneys" id="v">
                                            <option value="{$v.id}" <if condition="$list['moneys'] == $v['id']">selected </if> >{$v.name}</option>
                                        </volist>
                                    </select>
                                </div>
                            </div>
                            <div class="form-group" >
                                <label class="col-sm-2 col-sm-2 control-label">购房情况</label>
                                <div class="col-sm-10">
                                    <select  name="home" class="form-control">
                                        <volist name="biao.home" id="v">
                                            <option value="{$v.id}" <if condition="$list['home'] == $v['id']">selected </if> >{$v.name}</option>
                                        </volist>
                                    </select>
                                </div>
                            </div>
                            <div class="form-group" >
                                <label class="col-sm-2 col-sm-2 control-label">购车情况</label>
                                <div class="col-sm-10">
                                    <select  name="car" class="form-control">
                                        <volist name="biao.car" id="v">
                                            <option value="{$v.id}" <if condition="$list['car'] == $v['id']">selected </if> >{$v.name}</option>
                                        </volist>
                                    </select>
                                </div>
                            </div>
                            <div class="form-group" >
                                <label class="col-sm-2 col-sm-2 control-label">婚姻状况</label>
                                <div class="col-sm-10">
                                    <select  name="marriage" class="form-control">
                                        <volist name="biao.marriage" id="v">
                                            <option value="{$v.id}" <if condition="$list['marriage'] == $v['id']">selected </if> >{$v.name}</option>
                                        </volist>
                                    </select>
                                </div>
                            </div>
                            <div class="form-group" >
                                <label class="col-sm-2 col-sm-2 control-label">是否有孩子</label>
                                <div class="col-sm-10">
                                    <select  name="child" class="form-control">
                                        <volist name="biao.child" id="v">
                                            <option value="{$v.id}" <if condition="$list['child'] == $v['id']">selected </if> >{$v.name}</option>
                                        </volist>
                                    </select>
                                </div>
                            </div>
                            <div class="form-group" >
                                <label class="col-sm-2 col-sm-2 control-label">是否抽烟</label>
                                <div class="col-sm-10">
                                    <select  name="smoking" class="form-control">
                                        <volist name="biao.smoking" id="v">
                                            <option value="{$v.id}" <if condition="$list['smoking'] == $v['id']">selected </if> >{$v.name}</option>
                                        </volist>
                                    </select>
                                </div>
                            </div>
                            <div class="form-group" >
                                <label class="col-sm-2 col-sm-2 control-label">是否喝酒</label>
                                <div class="col-sm-10">
                                    <select  name="drinking" class="form-control">
                                        <volist name="biao.drinking" id="v">
                                            <option value="{$v.id}" <if condition="$list['drinking'] == $v['id']">selected </if> >{$v.name}</option>
                                        </volist>
                                    </select>
                                </div>
                            </div>
                            <div class="form-group" >
                                <label class="col-sm-2 col-sm-2 control-label">何时结婚</label>
                                <div class="col-sm-10">
                                    <select  name="marry_date" class="form-control">
                                        <volist name="biao.marry_date" id="v">
                                            <option value="{$v.id}" <if condition="$list['marry_date'] == $v['id']">selected </if> >{$v.name}</option>
                                        </volist>
                                    </select>
                                </div>
                            </div>
                        </div>
                        <div class="san">择偶条件</div>
                        <div>
                            <div class="form-group" >
                                <label class="col-sm-2 col-sm-2 control-label">工作地区***</label>
                                <div class="col-sm-10">
                                    <input name="ze_address" value="{$list.ze_address}" type="text"  class="form-control"
                                           placeholder="请输入地址">
                                </div>
                            </div>
                            <!--<div class="form-group" >
                                <label class="col-sm-2 col-sm-2 control-label">出生日期***</label>
                                <div class="col-sm-10">
                                    <input name="ze_age" value="{$list.ze_age}" type="text"  class="form-control"
                                           placeholder="请输入出生日期">
                                </div>
                            </div>-->
                            <div class="form-group" >
                                <label class="col-sm-2 col-sm-2 control-label">身高</label>
                                <div class="col-sm-10">
                                    <select  name="ze_heights" class="form-control">
                                        <volist name="biao.heights" id="v">
                                            <option value="{$v.id}" <if condition="$list['ze_heights'] == $v['id']">selected </if> >{$v.name}</option>
                                        </volist>
                                    </select>
                                </div>
                            </div>
                            <div class="form-group" >
                                <label class="col-sm-2 col-sm-2 control-label">体重</label>
                                <div class="col-sm-10">
                                    <select  name="ze_weights" class="form-control">
                                        <volist name="biao.weights" id="v">
                                            <option value="{$v.id}" <if condition="$list['ze_weights'] == $v['id']">selected </if> >{$v.name}</option>
                                        </volist>
                                    </select>
                                </div>
                            </div>
                            <div class="form-group" >
                                <label class="col-sm-2 col-sm-2 control-label">学历</label>
                                <div class="col-sm-10">
                                    <select  name="ze_education" class="form-control">
                                        <volist name="biao.education" id="v">
                                            <option value="{$v.id}" <if condition="$list['ze_education'] == $v['id']">selected </if> >{$v.name}</option>
                                        </volist>
                                    </select>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 col-sm-2 control-label">月收入</label>
                                <div class="col-sm-10">
                                    <select  name="ze_moneys" class="form-control">
                                        <volist name="biao.moneys" id="v">
                                            <option value="{$v.id}" <if condition="$list['ze_moneys'] == $v['id']">selected </if> >{$v.name}</option>
                                        </volist>
                                    </select>
                                </div>
                            </div>
                            <div class="form-group" >
                                <label class="col-sm-2 col-sm-2 control-label">购房情况</label>
                                <div class="col-sm-10">
                                    <select  name="ze_home" class="form-control">
                                        <volist name="biao.home" id="v">
                                            <option value="{$v.id}" <if condition="$list['ze_home'] == $v['id']">selected </if> >{$v.name}</option>
                                        </volist>
                                    </select>
                                </div>
                            </div>
                            <div class="form-group" >
                                <label class="col-sm-2 col-sm-2 control-label">购车情况</label>
                                <div class="col-sm-10">
                                    <select  name="ze_car" class="form-control">
                                        <volist name="biao.car" id="v">
                                            <option value="{$v.id}" <if condition="$list['ze_car'] == $v['id']">selected </if> >{$v.name}</option>
                                        </volist>
                                    </select>
                                </div>
                            </div>
                            <div class="form-group" >
                                <label class="col-sm-2 col-sm-2 control-label">婚姻状况</label>
                                <div class="col-sm-10">
                                    <select  name="ze_marriage" class="form-control">
                                        <volist name="biao.marriage" id="v">
                                            <option value="{$v.id}" <if condition="$list['ze_marriage'] == $v['id']">selected </if> >{$v.name}</option>
                                        </volist>
                                    </select>
                                </div>
                            </div>
                            <div class="form-group" >
                                <label class="col-sm-2 col-sm-2 control-label">是否有孩子</label>
                                <div class="col-sm-10">
                                    <select  name="ze_child" class="form-control">
                                        <volist name="biao.child" id="v">
                                            <option value="{$v.id}" <if condition="$list['ze_child'] == $v['id']">selected </if> >{$v.name}</option>
                                        </volist>
                                    </select>
                                </div>
                            </div>
                            <div class="form-group" >
                                <label class="col-sm-2 col-sm-2 control-label">是否抽烟</label>
                                <div class="col-sm-10">
                                    <select  name="ze_smoking" class="form-control">
                                        <volist name="biao.smokings" id="v">
                                            <option value="{$v.id}" <if condition="$list['ze_smoking'] == $v['id']">selected </if> >{$v.name}</option>
                                        </volist>
                                    </select>
                                </div>
                            </div>
                            <div class="form-group" >
                                <label class="col-sm-2 col-sm-2 control-label">是否喝酒</label>
                                <div class="col-sm-10">
                                    <select  name="ze_drinking" class="form-control">
                                        <volist name="biao.drinkings" id="v">
                                            <option value="{$v.id}" <if condition="$list['ze_drinking'] == $v['id']">selected </if> >{$v.name}</option>
                                        </volist>
                                    </select>
                                </div>
                            </div>
                        </div>
                        <div class="san">QQ/微信</div>
                        <div>
                            <div class="form-group" >
                                <label class="col-sm-2 col-sm-2 control-label">微信号</label>
                                <div class="col-sm-10">
                                    <input name="wechat" value="{$list.wechat}" type="text"  class="form-control"
                                           placeholder="请输入微信号">
                                </div>
                            </div>
                            <div class="form-group" >
                                <label class="col-sm-2 col-sm-2 control-label">QQ</label>
                                <div class="col-sm-10">
                                    <input name="qq" value="{$list.qq}" type="number"  class="form-control"
                                           placeholder="请输入QQ号码">
                                </div>
                            </div>
                        </div>

                        <div class="san">性格标签</div>
                        <div>
                            <div class="form-group" >
                                <label class="col-sm-2 col-sm-2 control-label">性格标签</label>
                                <div class="col-sm-10">
                                    <if condition="$list.tags neq null">
                                        <volist name="list.tags" id="v">
                                            <div>
                                                <input <if condition="$v.choose eq true">checked</if> type="checkbox" name="tags[]" value="{$v.name}" style="margin-left: 10px;zoom: 150%;">
                                                <span style="margin-left: 5px;">{$v.name}</span>
                                            </div>
                                        </volist>
                                        <else/>
                                        <volist name="biao.tags" id="v">
                                            <div>
                                                <input type="checkbox" name="tags[]" value="{$v.name}" style="margin-left: 10px;zoom: 150%;">
                                                <span style="margin-left: 5px;">{$v.name}</span>
                                            </div>
                                        </volist>
                                    </if>
                                </div>
                            </div>
                        </div>

                        <div class="san">休假情况</div>
                        <div>
                            <div class="form-group" >
                                <label class="col-sm-2 col-sm-2 control-label">休假情况</label>
                                <div class="col-sm-10">
                                    <if condition="$list.vacation">
                                        <volist name="list.vacation" id="v">
                                            <div>
                                                <input <if condition="$v.choose eq true">checked</if> type="checkbox" name="vacation[]" value="{$v.week}" style="margin-left: 10px;zoom: 150%;">
                                                <span style="margin-left: 5px;">{$v.week}</span>
                                            </div>
                                        </volist>
                                        <else/>
                                        <volist name="biao.vacation" id="v">
                                            <div>
                                                <input type="checkbox" name="vacation[]" value="{$v.week}" style="margin-left: 10px;zoom: 150%;">
                                                <span style="margin-left: 5px;">{$v.week}</span>
                                            </div>
                                        </volist>
                                    </if>
                                </div>
                            </div>
                        </div>

                        <input type="hidden"  name="id" value="{$list.id}">
                        <div class="form-group">
                            <label class="col-sm-2 col-sm-2 control-label"></label>
                            <div class="col-sm-10">
                                <input  type="button" id="tianjia" class="btn btn-theme" value="保存" style="width: 150px;margin-left: 60px">
                                <input  type="reset" class="btn btn-warning" value="重置" style="width: 150px">
                            </div>
                        </div>
                    </form>
                </div>
            </div><!-- col-lg-12-->
        </div><!-- /row -->
    </section>
</section>
<!--footer-->
<include file="Public:footer"/>
<!--footer-->
<script type="text/javascript" src="__PUBLIC__/ui/lib/layer/2.4/layer.js"></script>
<script>
    $("#type").change(function () {
        if($("#type").is(":checked")){
            $("#vip_type").show();
            $("#gou").hide();
        }else{
            $("#vip_type").hide();
            $("#gou").show();
        }
    })
    $("#two_img").change(function () {
        var form = new FormData(document.getElementById("two_img"));
        $.ajax({
            url:"{:U('two_img')}",
            type:"post",
            data:form,
            processData:false,
            contentType:false,
            success:function(data){
                console.log(data)
            }
        });
    })
    $("#one_img").change(function () {
        var form = new FormData(document.getElementById("one_img"));
        $.ajax({
            url:"{:U('one_img')}",
            type:"post",
            data:form,
            processData:false,
            contentType:false,
            success:function(data){
                console.log(data)
            }
        });
    })
    $("#tianjia").click(function () {
        var form = new FormData(document.getElementById("myForm"));
        $.ajax({
            url:"{:U('info_add')}",
            type:"post",
            data:form,
            processData:false,
            contentType:false,
            success:function(data){
                if(data.status == 1){
                    layer.open({
                        title: '提示'
                        ,content: "系统有误，操作失败"
                    });
                }
                if(data.status == 2){
                    layer.open({
                        title: '提示'
                        ,content: "操作成功"
                    });
                }
                if(data.status == 3){
                    layer.open({
                        title: '提示'
                        ,content: "操作失败"
                    });
                }
            }
        });
    })
    //图片上传
    function openFile(){
        return  $("#avatar").click();
    }

    function PreviewImage(imgFile)
    {
        var filextension=imgFile.value.substring(imgFile.value.lastIndexOf("."),imgFile.value.length);
        var o=imgFile.files[0];
        filextension=filextension.toLowerCase();
        if ((filextension!='.jpg')&&(filextension!='.jpeg')&&(filextension!='.png')&&(filextension!='.bmp')) {
            imgFile.focus();
        }else if(o.size > 2097152){
            imgFile.focus();
        } else {
            var path;
            path=window.URL.createObjectURL(imgFile.files[0]);// FF 7.0以上
            $('.ph-user').attr({src:path});
        }
    }


</script>

</body>
</html>


